<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>开关灯</title>
		<script src="js/vue.js"></script>
	</head>
	<body>
		<div id='app'>
			<button @click="light=!light">
				{{light ? "关灯":"开灯"}}
			</button> <br>
			<img v-if='light' src="img/on.jpg" alt="">
			<img v-else src="img/off.jpg" alt="">
		</div>
		<script>
			Vue.createApp({
				data(){
					return{
						light:false
					}
				}
			}).mount('#app')
		</script>
	</body>
</html>